<?php
/**
 +------------------------------------------------------------------------------
 * 分页类
 +------------------------------------------------------------------------------
 * @Version   1.4
 * @Author    WangXian
 * @FileName WapLink.class.php
 * @Creation date 2010-9-14
 * @Modified date 2010-9-20
 +------------------------------------------------------------------------------
 */
class WapLink
{
	/**
	 +----------------------------------------------------------
	 * wap分页样式1
	 +----------------------------------------------------------
	 * @param string $page 当前页数
	 * @param string $allnums 总页数
	 * @param string $url 连接不变的url
	 * @param integer $max_rows 每页的数据数
	 +----------------------------------------------------------
	 * @return string
	 +----------------------------------------------------------
	 */
 	public static function show1($page,$allnums, $url, $max_rows=10 )
	{
		$allPageNums = ceil($allnums/$max_rows);

		$out = '';
		$out.='<form method="post" action="'. $url .'">';

	    // 上一页
		if ($page > 1)
			$out.= '<a href="'.$url.'/page/'.($page-1).'">上页</a>&nbsp;';

		// 下一页
	    if ( $page < $allPageNums )
	      	$out .= '<a href="'. $url .'/page/'.($page+1).'">下页&nbsp;</a>';

		$out .='&nbsp;&nbsp;<input type="text" name="page" size="2" value="'.$page.'" />';
		$out .='<input type="submit" name="subt" value="跳转" />';
		$out .= '&nbsp;&nbsp;'.$page.'/'.$allPageNums.'页';

		$out .='</form>';

		return $out;
	}
}





/* End of file WapLink.class.php */
/* Location: WapLink.class.php */